//  导入request。js请求工具
import request from '@/uitls/request.js';
//提供调用注册接口函数
export const userRegister = (params) => {
  return request.post('/user/register', params);
}
// 登录接口
export const userLogin = (params) => {
  return request.post('/user/login', params);
}

//获取用户详细信息

export const userInfo =()=>{
  return request.get('/user/userInfo')
}

// 修改用户信息
export const userInfoUpdate = (params) =>{
  return request.put('user/update',params);
}

//修改头像
export const userAvatarUpdateService=(avatarUrl)=>{
    let params = new URLSearchParams();
    params.append('avatar',avatarUrl)
    return request.patch('/user/updateAvatar',params)
}


// 修改密码
export const userPasswordUpdate = (params) =>{
  return request.post('/user/updatePWD',params);
}